{extend name="./base" /}

{block name="css"}
<style>
	.site_list{width: 100%;min-height: 800px; display: flex;flex-wrap: wrap;background-color: #ffffff;padding: 20px;align-content:flex-start;}
	.item-block{width: 15%;margin-right: 2%;margin-bottom: 25px;display: flex;justify-content: space-around;background-color: #f7f8fa;height: 50px;padding: 15px}
	.item-pic{width: 40px;height:40px;}
	.item-pic img{max-width: 100%;max-height: 100%;}
	.item-con{display: flex; flex-direction: column;margin-left: 20px;}
	.item-con-title{font-size: 14px;color: #666;}
	.item-con-desc{font-size: 12px;color: #999;}
	.item-act{line-height: 40px}
</style>
{/block}

{block name="body"}
<div class="site_list">
	<div class="item-block">
		<div class="item-pic">
			<img src="__STATIC__/img/system/data.png">
		</div>
		<div class="item-con">
			<div class="item-con-title">模板缓存</div>
			<div class="item-con-desc">模板缓存</div>
		</div>
		<div class="item-act">
			<a class="layui-btn layui-btn-xs layui-btn-danger" onclick="del(1)">删除</a>
		</div>
	</div>
	<div class="item-block">
		<div class="item-pic">
			<img src="__STATIC__/img/system/data.png">
		</div>
		<div class="item-con">
			<div class="item-con-title">数据缓存</div>
			<div class="item-con-desc">数据缓存</div>
		</div>
		<div class="item-act">
			<a class="layui-btn layui-btn-xs layui-btn-danger" onclick="del(2)">删除</a>
		</div>
	</div>
</div>
{/block}

{block name="script"}
<script>
	function del(type){
		$.post('/admin/caches/index', {type: type}, function(res){
			if (res.code == 0){
				layer.msg('删除成功', {time: 1000}, function(){
					window.location.reload();
				})
			}else{
				layer.msg(res.msg)
			}
		});
	}
</script>
{/block}